home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 / Ham Radio 2000.iso / ham2000 / morse / dspmorse / morse.h < prev    next >
C/C++ Source or Header  |  1993-12-19  |  2KB  |  75 lines

  1. //
  2. //    MORSE.H
  3. //        Global morse header.
  4. //
  5.  
  6. //    Standard libraries
  7.  
  8. #include <io.h>
  9. #include <dos.h>
  10. #include <time.h>
  11. #include <alloc.h>
  12. #include <conio.h>
  13. #include <stdio.h>
  14. #include <stdlib.h>
  15. #include <string.h>
  16.  
  17. //    Convenient types
  18.  
  19. typedef unsigned int UINT;
  20. typedef unsigned char UCHAR;
  21. typedef unsigned long ULONG;
  22. typedef signed char SCHAR;
  23.  
  24. //    Other headers
  25.  
  26. #include "sb.h"
  27. #include "vid.h"
  28.  
  29. //    Video constants
  30.  
  31. #define BOXTOP        0x00                // 0-based line of box top
  32. #define BOXDIV        0x0B                // 0-based line of box divider
  33. #define BOXBOT        0x16                // 0-based line of box bottom
  34. #define    BOXLEF        0x00                // 0-based column of box left
  35. #define BOXRIG        0x23                // 0-based column of box right
  36. #define VIDSEG        0xB800                // assume color display
  37. #define GRAPHTOP    72                    // rightmost graph character
  38. #define BLU            42                    // left of this column is blue
  39. #define GRN            (BLU+((GRAPHTOP-41)>>1))                    // is green
  40. #define YEL            (GRN+((GRAPHTOP-41)>>2)+((GRAPHTOP-41)>>3))    // is yellow
  41.  
  42. //    Audio constants
  43.  
  44. #define SAMPLELEN    1000                // sample buffer size
  45. #define SAMPLEMIN    1000                // samples per second
  46. #define SAMPLEMAX    44000
  47. #define SAMPLEINC    1000
  48. #define MAXBUF        0xFF
  49. #define MINBUF        0x01
  50.  
  51. #define TRUE        1                    // true value (C compatible)
  52. #define FALSE        0                    // false value (C compatible)
  53.  
  54. //    Math constants
  55.  
  56. #define N            16    // number of FFT terms; do not change this!
  57. #define LOG2N        4    // Log2n (see N)
  58.  
  59. #define S0            0    // 4-bit SIN table S0 == sin(0)
  60. #define S1             3    // increasing precision will create integer overflows
  61. #define S2             6
  62. #define S3             9
  63. #define S4            11
  64. #define S5            13
  65. #define S6            15
  66. #define S7            16
  67. #define S8            16    // S8 == sin(1)
  68. #define SCALE        11    // scales FFT value to something manageable
  69.  
  70. #define MAXFFT        255    // maximum FFTs to hold
  71.  
  72. //
  73. //    end of MORSE.H
  74. //
  75.